home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / Freeware / PerfectPaint / rexx / Anim / CloneAnim.rx next >
Text File  |  2001-10-26  |  2KB  |  114 lines

  1. /*     arexx Script 
  2. */
  3.  
  4.     options results
  5.     parse ARG Port b
  6.     
  7.     ADDRESS value Port
  8.  
  9.     pp_GetDepth
  10.     D=result
  11.     pp_GetWidth
  12.     W=result
  13.     pp_GetHeight
  14.     H=result
  15.  
  16.     pp_CountFrames
  17.     count=result
  18.     IF count<2 then DO
  19.         pp_Warn 'Make*an*Anim*first.'
  20.         EXIT
  21.     END
  22.  
  23.     pp_GetCurrentBuffer
  24.     CBf=result
  25.  
  26.     if D<24 then DO
  27.         pp_Psave "ram:palette.trash" 0
  28.     END
  29.  
  30.     pp_FindEmptyBuffer
  31.     flag=result
  32.     if flag=-1 then DO
  33.         pp_Warn "can't*find*empty|Buffer."
  34.         EXIT        
  35.     END
  36.  
  37.     s0=1
  38.     s1=Count
  39.     ADDRESS value Port
  40.     pp_DialogInit 250 80 "*Clone*Anim*" 2
  41.         pp_Slider 0 100 5 100 16 "First*Frame*#" 1 1 count s0
  42.         pp_Slider 1 100 25 100 16 "Last*Frame*#" 1 1 count s1
  43.     pp_Dialog
  44.     rc=result
  45.     IF rc=0 THEN DO
  46.         EXIT
  47.     END
  48.  
  49.     pp_GetDialog 0
  50.     s0=result
  51.  
  52.     pp_GetDialog 1
  53.     s1=result
  54.     
  55.     pp_GotoFrame s0
  56.  
  57.     pp_SetBuffer flag
  58.     pp_GetWidth
  59.     if result~=0 then DO
  60.         pp_Request "This*Buffer*is*not*empty.|Do*you*want*to*erase*it*?"
  61.         if result=0 then DO
  62.             EXIT
  63.         END
  64.         ELSE DO
  65.             pp_ClearCurrentBuffer            
  66.         END
  67.     END    
  68.  
  69.     pp_new W H D
  70.     pp_GetWidth
  71.     IF result=0 then DO
  72.         pp_Warn "Not*enough*memory."
  73.         EXIT            
  74.     END
  75.  
  76.     IF D<24 then DO
  77.         pp_Pload "ram:palette.trash"
  78.         ADDRESS COMMAND
  79.         'delete >nil: ram:palette.trash'
  80.         ADDRESS value Port
  81.     END    
  82.  
  83.     pp_AnimGui 1
  84.     IF result<2 then DO
  85.         EXIT
  86.     END
  87.  
  88.     pp_MakeAnim (s1-s0)+1
  89.     pp_CountFrames
  90.     Count=result
  91.     IF Count<2 then DO
  92.         pp_Warn "Can't*create*animation."
  93.         EXIT
  94.     END
  95.  
  96.     pp_GotoFrame 1
  97.     pp_progresstext 'Cloning*Anim'        
  98.     DO i=1 to Count
  99.         F=s0+(i-1)
  100.         pp_Progress i Count
  101.         pp_CopyAnimFrame CBf flag F i    
  102.     END
  103.  
  104.     pp_CloneJiffies CBf flag
  105.     pp_Progressclr
  106.     pp_GotoFrame 1
  107.     
  108.     EXIT
  109.     
  110.  
  111.  
  112.     
  113.  
  114.